package com.educate.device.dao;

import com.educate.device.dao.impl.DeviceMessageDaoImpl;
import com.educate.device.model.bo.DeviceMessageBO;
import com.educate.device.model.po.DeviceMessage;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;

import java.util.Optional;

@Repository
public interface DeviceMessageDao extends MongoRepository<DeviceMessage, String> {

    /**
     * #{@link DeviceMessageDaoImpl#query(DeviceMessageBO, Pageable)}
     */
    Page<DeviceMessage> query(DeviceMessageBO bo, Pageable pageable);

    Optional<DeviceMessage> findByDeviceIdAndMessageId(String deviceId, String messageId);
}
